package com.atguigu.tingshu.user.client;


import com.atguigu.tingshu.model.user.UserInfo;
import com.atguigu.tingshu.model.user.VipServiceConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/***
 * 用户微服务的feign接口
 */
@FeignClient(value = "service-user", path = "/client/user/userInfo", contextId = "userClientFeign")
public interface UserClientFeign {

    /**
     * 根据id查询用户信息
     *
     * @param userId
     * @return
     */
    @GetMapping("/getUserInfo/{userId}")
    public UserInfo getUserInfo(
            @PathVariable("userId") Long userId);

    /**
     * 查询用户购买过的指定专辑的声音
     * @param albumId
     * @param userId
     * @return
     */
    @GetMapping("/getUserPaidTrack/{albumId}/{userId}")
    public Map<String,Object> getUserPaidTrack(@PathVariable("albumId")Long albumId,
                                               @PathVariable("userId")Long userId);

    /**
     * 查询用户购买的指定id的专辑
     * @param albumId
     * @param userId
     * @return
     */
    @GetMapping("/getUserPaidAlbum/{albumId}/{userId}")
    public Boolean getUserPaidAlbum(@PathVariable("albumId") Long albumId,
                                    @PathVariable("userId") Long userId);


    /**
     * 根据itemId查询VIP类型
     * @param itemId
     * @return
     */
    @GetMapping("/getVipServiceConfig/{itemId}")
    public VipServiceConfig getVipServiceConfig(@PathVariable("itemId")Long itemId);


}